package cn.wolfcode.wolf2w.search.service.impl;

import cn.wolfcode.wolf2w.domain.Destination;
import cn.wolfcode.wolf2w.search.domain.DestinationEs;
import cn.wolfcode.wolf2w.search.repository.DestinationESRepository;
import cn.wolfcode.wolf2w.search.service.IDestinationESService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DestinationESImpl implements IDestinationESService {

    @Autowired
    private DestinationESRepository destinationESRepository;
    @Override
    public void insert(DestinationEs destinationEs) {
        destinationESRepository.save(destinationEs);
    }


    //通过关键字查询出目的地
    @Override
    public Destination queryByKeyword(String keyword) {
        Destination destination=destinationESRepository.queryByName(keyword);
        return destination;
    }
}
